home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
rjs.lha
/
RJS
/
Transport
/
tests
/
dc.C
next >
Wrap
C/C++ Source or Header
|
1991-06-14
|
769b
|
40 lines
#include <iostream.h>
#include <fstream.h>
#include <stdio.h>
#include <osfcn.h>
#include <libc.h>
#include "RJS/Transport.h"
#include "RJS/Convert.h"
static char buffer [512000];
void test(char *name, char *obj)
{
RJS_DECnetAddress server_address(name,RJS_Convert::toInt(obj));
RJS_DECnetSeqPacket server;
// cout << server_address.ss_message() << endl;
fstream bin_file("testing",ios::out);
server.active(server_address);
server.linger();
int tot=server.read(buffer,512000); // read from server
bin_file.write(buffer,tot);
cout << "client: read ==> '" << tot << "'" << endl;
}
int main(int argc, char *argv[])
{
if (argc!=3) {
cout<< "usage: " << argv[0] << "host object " << endl;
exit(1);
}
test(argv[1],argv[2]);
exit(0);
}